package com.zrq.secondkill.service;


import org.springframework.lang.Nullable;

import java.util.concurrent.TimeUnit;

/**
 * 简单分层次的缓存,从顶向下读取,任何一层有结果则返回,写时从顶向下写,可设置写几层
 * 目的是减少逐层查询缓存再逐层设置的含多层if嵌套的样板代码
 *
 * @author zrq
 */
public interface SimplelayeredCacheService {

    void setK(String key, Object value, @Nullable long expire, @Nullable TimeUnit timeUnit, int k);

    Object get(String key);
}
